home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / share / pyshared / launchpadbugs / lpconstants.py < prev    next >
Text File  |  2008-08-27  |  6KB  |  193 lines

  1. import os.path
  2.  
  3. ##########
  4. #BASEURL
  5. ##########
  6. class BASEURL(object):
  7.     # urls have to server independent
  8.     _MAP = (
  9.         ("BUG", "https://bugs.launchpad.net"),
  10.         # https://bugs.edge.launchpad.net/ubuntu/+source/bughelper/+bug/153846/+text
  11.         ("BUGLIST", "https://bugs.launchpad.net"),
  12.         ("BUGPAGE", "https://bugs.launchpad.net"),
  13.         ("BLUEPRINT", "https://blueprints.launchpad.net"),
  14.         ("BLUEPRINTLIST", "https://blueprints.launchpad.net"),
  15.         ("PROJECTLIST", "https://launchpad.net"),
  16.     )
  17. for i in BASEURL._MAP:
  18.     setattr(BASEURL, *i)
  19.     
  20. ##########
  21. #Bug
  22. ##########
  23. class BUG:
  24.     STATUS = {  'statusNEW': 'New',
  25.                 "statusINCOMPLETE": 'Incomplete',
  26.                 'statusINVALID': 'Invalid',
  27.                 "statusWONTFIX": 'Won\'t Fix',
  28.                 "statusCONFIRMED": 'Confirmed',
  29.                 "statusTRIAGED": 'Triaged',
  30.                 "statusINPROGRESS": 'In Progress',
  31.                 'statusFIXCOMMITTED': 'Fix Committed',
  32.                 'statusFIXRELEASED': 'Fix Released'}
  33.                 
  34.     STATUS_INCOMPLETE_ADD = { 'INCOMPLETE_WITH_RESPONSE': 'Incomplete w/',
  35.                               "INCOMPLETE_WITHOUT_RESPONSE": 'Incomplete w/o'}
  36.                 
  37.     SORT_STATUS = ["Fix Released","Fix Committed","In Progress",\
  38.             "Triaged", "Confirmed","Won\'t Fix","Invalid","Incomplete", "New"]
  39.                 
  40.     IMPORTANCE = {  "importanceUNDECIDED": "Undecided",
  41.                     "importanceWISHLIST": "Wishlist",
  42.                     "importanceLOW": "Low",
  43.                     "importanceMEDIUM": "Medium",
  44.                     "importanceHIGH": "High",
  45.                     "importanceCRITICAL": "Critical"}
  46.  
  47.     SORT_IMPORTANCE = ["Critical","High","Medium","Low","Wishlist","Undecided"]
  48.  
  49.  
  50. ##########
  51. #Buglist
  52. ##########
  53. class BUGLIST:
  54.     DEFAULT_DISTRO = "ubuntu"
  55.     
  56.     COMPONENT_DICT = { "main": 1,
  57.                        "restricted": 2,
  58.                        "universe": 3,
  59.                        "multiverse": 4,
  60.                        "contrib": 5,
  61.                        "non-free": 6,
  62.                        "partner": 7}
  63.  
  64.  
  65. ##########
  66. #Blueprint
  67. ##########
  68. class BLUEPRINT:
  69.     PRIORITY = {
  70.         "specpriorityESSENTIAL" : "Essential",
  71.         "specpriorityHIGH" : "High",
  72.         "specpriorityMEDIUM" : "Medium",
  73.         "specpriorityLOW" : "Low",
  74.         "specpriorityUNDEFINED" : "Undefined",
  75.         "specpriorityNOTFORUS": "Not"
  76.         #MORE?
  77.     }
  78.     SORT_PRIORITY = ["Essential", "High", "Medium", "Low", "Undefined", "Not"]
  79.  
  80.     STATUS = {
  81.         "specstatusAPPROVED" : "Approved",
  82.         "specstatusPENDINGAPPROVAL" : "Pending Approval",
  83.         "specstatusPENDINGREVIEW" : "Review",
  84.         "specstatusDRAFT" : "Drafting",
  85.         "specstatusDISCUSSION" : "Discussion",
  86.         "specstatusNEW" : "New",
  87.         "specstatusSUPERSEDED" : "Superseded",
  88.         "specstatusOBSOLETE" : "Obsolete"
  89.     }
  90.     SORT_STATUS = ["Approved", "Pending Approval", "Review", "Drafting",
  91.                     "Discussion", "New", "Superseded", "Obsolete"]
  92.  
  93.     DELIVERY = {
  94.         "specdeliveryUNKNOWN" : "Unknown",
  95.         "specdeliveryINFORMATIONAL" : "Informational",
  96.         "specdeliveryIMPLEMENTED" : "Implemented",
  97.         "specdeliveryNOTSTARTED" : "Not started",
  98.         "specdeliveryBETA" : "Beta Available",
  99.         "specdeliverySTARTED" : "Started",
  100.         "specdeliveryDEFERRED" : "Deferred",
  101.         "specdeliveryBLOCKED" : "Blocked",
  102.         "specdeliveryGOOD" : "Good progress",
  103.         "specdeliveryAWAITINGDEPLOYMENT" : "Awaiting deployment",
  104.         "specdeliverySLOW"  : "Slow progress",
  105.         "specdeliveryNEEDSREVIEW" : "Needs code review",
  106.         "specdeliveryNEEDSINFRASTRUCTURE" : "Needs Infrastructure"
  107.     }
  108.     SORT_DELIVERY = ["Unknown", "Not started", "Deferred",
  109.             "Needs Infrastructure", "Blocked", "Started", "Slow progress",
  110.             "Good progress", "Beta Available", "Needs Code Review",
  111.             "Deployment", "Implemented", "Informational"]
  112.             
  113.             
  114. ################
  115. #ATTACHMENTS
  116. ################
  117. class ATTACHMENTS:
  118.     ATTACHMENT_PATH = "~/.bughelper/attachments-cache" # default should be None
  119.     CONTENT_TYPES = ["text/html"] # default should be an empty-list
  120.     
  121.     
  122. ################
  123. #HTTPConnection
  124. ################
  125. class HTTPCONNECTION:
  126.     class MODE:
  127.         DEFAULT, EDGE, STABLE, STAGING = range(4)
  128.         
  129. class CONFIG:
  130.     FILE = os.path.expanduser("~/.python-launchpad-bugs.conf")
  131.     COMMENT = """# global configuration for python-launchpad-bugs.
  132. # user.username: user related identifier shown in the user-agent header
  133. # test_examples.*: example data for unittests
  134. # test_config.*:
  135. # cookies.*: default cookies, please do not modify the values, if you
  136. #    delete one entry, a new cookie will be generated\n\n"""
  137.     DEFAULT = """
  138. [user]
  139. lplogin =
  140.  
  141. [cookies]
  142. lp =
  143. edge =
  144. staging =
  145. inhibit_beta_redirect =
  146.  
  147. [test_examples]
  148. password =
  149. email =
  150. cookiefile =
  151.  
  152. [test_config]
  153. tests =
  154. ignore =
  155. mail_cmd =
  156. """
  157. class _MODE_WRAPPER(object):
  158.     def __init__(self, id, identifier):
  159.         self.__id = id
  160.         self.__identifier = identifier
  161.         
  162.     def __int__(self):
  163.         return int(self.__id)
  164.         
  165.     def __str__(self):
  166.         return self.__identifier
  167.     
  168.     def __repr__(self):
  169.         return "<MODE '%s'>" %self.__identifier
  170.  
  171. class CONNECTOR:
  172.     class MODES:
  173.         _MAP = ("HTML", "TEXT")
  174.         HTML, TEXT = map(lambda x: _MODE_WRAPPER(*x), enumerate(_MAP))
  175.         DEFAULT = HTML
  176.         
  177.     CONNECTIONS = {
  178.         MODES.HTML : {
  179.             "Bug": ("html_bug", ("http_connection", "HTTPConnection")),
  180.             "BugList": ("html_buglist", ("http_connection", "HTTPConnection")),
  181.  
  182.             "Blueprint": ("html_blueprint", ("http_connection", "HTTPConnection")),
  183.             "BlueprintList": ("html_blueprintlist", ("http_connection", "HTTPConnection")),
  184.  
  185.             "ProjectList": ("html_projectlist", ("http_connection", "HTTPConnection")),
  186.             "ProjectPackageList": ("html_projectlist", ("http_connection", "HTTPConnection")),
  187.         },
  188.         MODES.TEXT : {
  189.             "Bug": ("text_bug", ("http_connection", "HTTPConnection")),
  190.             "BugList": ("text_buglist", ("http_connection", "HTTPConnection")),
  191.         },
  192.     }
  193.